<?php
namespace Lib\Source;
use Lib\Source\SourceException,
    Lib\Source\DriverInterface;

class DriverFactory{
    private function __construct($options = array()){}
    private function __clone(){} 
    
    
    /**
     * Creates instance of encryption driver
     * 
     * @param int $driverName
     * @throws SourceException
     * @return DriverInterface
     */
    public static function factory($sourceName = self::DRIVER_ZEND_REGISTRY, $sourceOptions = array()){
        $sourceName = __NAMESPACE__ . '\\Driver\\' .$sourceName;
        $source = new  $sourceName();
        $source->setOptions($sourceOptions);
        return $source;
    }
}